<!--
 * @Descripttion: (/SensorRealTimeDataTable)
 * @version: (1.0)
 * @Author: (admin)
 * @Date: (2025-09-09)
 * @LastEditors: (admin)
 * @LastEditTime: (2025-09-09)
-->
<template>
  <div class="app-container">
    <!--图表-->
    <div ref="chartContainer" style="width: 100%; height: 500px;"></div>

  </div>
</template>

<script>
import {
  listSensorRealTimeDataTable,
  getSensorRealTimeDataTable,
} from '@/api/gb/sensorRealTimeDataTable.js';
import * as echarts from 'echarts';

export default {
  name: "sensorrealtimedatatable",
  data() {
    return {
      // ... existing code ...
      chart: null, // 图表实例
    };
  },
  mounted() {
    this.initChart();
  },
  methods: {
    // 初始化图表
    initChart() {
      this.chart = echarts.init(this.$refs.chartContainer);
      // 基础配置
      const option = {
        title: {
          text: '水平曲线'
        },
        xAxis: {
          type: 'category',
          data: ['支架1', '支架2', '支架3', '支架4', '支架5', '支架6', '支架7']
        },
        yAxis: {
          type: 'value',
          name: '偏移量(cm)',
        },
        series: [
          {
            data: [10, 20, 30, 40, 50, 60, 70],
            type: 'line',
            symbolSize: 0,
            lineStyle: {
              color: '#edd715',
              width: 4,
              type: 'dashed'
            }
          }
        ]
      };
      this.chart.setOption(option);
    },
    // ... existing code ...
  }
};
</script>